package com.awaken.content.models.dto;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * Demo响应DTO
 *
 * @author bytearch
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class DemoDTO implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 响应ID
     */
    private String id;

    /**
     * 响应消息
     */
    private String message;

    /**
     * 处理状态
     */
    private Boolean success;

    /**
     * 响应时间
     */
    private LocalDateTime responseTime;

    /**
     * 额外数据
     */
    private Object data;

    public static DemoDTO success(String message) {
        return new DemoDTO(null, message, true, LocalDateTime.now(), null);
    }

    public static DemoDTO success(String message, Object data) {
        return new DemoDTO(null, message, true, LocalDateTime.now(), data);
    }

    public static DemoDTO fail(String message) {
        return new DemoDTO(null, message, false, LocalDateTime.now(), null);
    }
}
